import React from 'react'
import { Card } from 'antd-mobile'
import "./cate.less"
import { withRouter } from 'react-router-dom'

function Cate(props) {
  console.log(props.cate);

  return (
    <div className='cate'>
      <div>
        <Card title='1重利 新人特价商品专区 （限量供应，先到先得）' onClick={() => { }}>
          {props.cate.length > 0 ? (
            <>
              {props.cate.map((item) => {
                return (
                  <div className='cate_div' key={item.id} onClick={() => { props.history.push("/detail/" + item.id + "/type=1") }}>
                    <img src={props.pre + item.img} alt="" />
                    <div>
                      <div>
                        <p>￥{item.price}</p>
                        <p>￥{item.market_price}</p>
                      </div>
                      {/* <img src={shop} alt="" /> */}
                    </div>
                  </div>
                )
              })}
            </>
          ) : null}
        </Card>
      </div>
    </div>
  )
}

export default withRouter(Cate)